import java.util.Arrays;

/**
 * @Author 12629
 * @Description：
 */
public class Test2 {
    void bubbleSort(int[] array) {
        int[] tmp = Arrays.copyOf(array,array.length);
        for (int end = tmp.length; end > 0; end--) {
            boolean sorted = true;
            for (int i = 1; i < end; i++) {
                if (tmp[i - 1] > tmp[i]) {
                    swap(tmp, i - 1, i);
                    sorted = false;
                }
            }
            if(sorted == true) {
                break;
            }
        }
        for (int i = 0; i < array.length; i++) {
            array[i] = tmp[i];
        }
    }

    private void swap(int[] array, int i, int i1) {

    }

    public static void main(String[] args) {

    }
}
